<template>
  <div class="content">
    <div class="herdertop">
      <img src="../../assets/top.png" alt="" class="topImg" />
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>服务管理</el-breadcrumb-item>
        <el-breadcrumb-item>报事详情</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="center" style="padding-top: 0px;">
      <div class="hander">报事详情</div>
      <div class="orderList">
        <div class="left">
          <div class="lefter">
            <p>房号：</p>
            <p class="lefters">{{ infoData.houseFullName }}</p>
          </div>
          <div class="lefter">
            <p>报事人：</p>
            <p class="lefters">{{ infoData.userName }}</p>
          </div>
          <div class="lefter">
            <p>维修单号：</p>
            <p class="lefters">{{ infoData.orderNo }}</p>
          </div>
          <div class="lefter">
            <p>手机号：</p>
            <p class="lefters">{{ infoData.phone }}</p>
          </div>
          <div class="lefter">
            <p>报事时间：</p>
            <p class="lefters">{{ infoData.createTime }}</p>
          </div>
          <div class="lefter">
            <p>报事类型：</p>
            <p class="lefters">{{ infoData.serviceName }}</p>
          </div>
          <div class="lefter">
            <p>报事内容：</p>
            <p class="lefters">{{ infoData.content }}</p>
          </div>
          <div class="lefter">
            <p>报事状态：</p>
            <p class="lefters">
              {{
                infoData.orderStatus == 1
                  ? "待处理"
                  : infoData.orderStatus == 2
                  ? "待评价"
                  : infoData.orderStatus == 3
                  ? "已评价"
                  : infoData.orderStatus == 4
                  ? "已完成"
                  : infoData.orderStatus == 5
                  ? "已完成"
                  : "已取消"
              }}
            </p>
          </div>
          <!-- <div class="lefter">
            <p>报事图片：</p>
            <p class="lefters" v-for="(item,index) in infoData.workOrderAttach" :key="index">
              <img :src="item.attachType==2?item.attachUrl:'暂无图片'" alt="">
            </p>
          </div> -->
          <div class="lefter">
            <p>报事人评价：</p>
            <p class="lefters">
              {{
                infoData.workOrderEvaluateVO &&
                  infoData.workOrderEvaluateVO.comment
              }}
            </p>
          </div>
          <div class="lefter">
            <p>报事人评分：</p>
            <p class="lefters">
              {{
                infoData.workOrderEvaluateVO &&
                  infoData.workOrderEvaluateVO.evaluationStar
              }}
            </p>
          </div>
          <el-button @click.native.prevent="isGoBack">返回</el-button>
        </div>
        <div class="right">
          <div style="height: 100%;">
            <div class="merss" v-if="list.length === 0">暂无数据</div>
            <el-steps direction="vertical" :active="0">
              <el-step
                v-for="(item, index) in list"
                :key="index"
                :title="item.handleTime"
                :description="item.trackDescription"
              ></el-step>
            </el-steps>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      orderNo: "",
      infoData: [],
      list: []
    };
  },
  activated() {
    this.orderNo = this.$route.query.orderNo || "";
    this.getWorkOrderDetailInfo();
  },
  methods: {
    //详情调用
    getWorkOrderDetailInfo() {
      this.$http({
        url: "/orderadmin/mgr/workOrder/getWorkOrderDetailInfo",
        method: "GET",
        params: {
          orderNo: this.orderNo
        }
      })
        .then(res => {
          if (res.success == 1) {
            this.infoData = res.data;
            var fruits = res.data.workOrderTrack;
            this.list = fruits.reverse();
          } else {
            this.$message.error(res.errorMsg);
          }
        })
        .catch(() => {
          this.$message.error("获取详情失败");
        });
    },
    //返回
    isGoBack() {
      this.$router.push({
        name: "workOrderEvaluate"
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.hander {
  width: 100%;
  line-height: 50px;
  font-size: 20px;
  font-weight: 900;
}
.orderList {
  background-color: #ebeef1;
  padding: 12px;
  // height: 300px;
  display: block;
  font-size: 16px;
  border-radius: 20px;
  list-style-type: none;
  display: flex;
  .left {
    flex: 1;
    // height: 200px;
    display: flex;
    padding: 10px;
    flex-direction: column;
    background-color: #fff;
    border-right-color: #ebeef1;
    border-right-style: solid;
    border-right-width: 4px;
  }
  .right {
    flex: 1;
    padding: 10px;
    background-color: #fff;
  }
}
.lefter {
  display: flex;
  margin-top: 10px;
  justify-content: space-between;
  .lefters {
    width: 166px;
  }
}
.herdertop {
  height: 8vh;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
}
.topImg {
  margin-right: 20px;
}
.entirety {
  width: 100%;
  margin: 10px;
  height: 100%;
  background-color: #fff;
  border-radius: 10px;
  display: flex;
  padding-left: 10px;
}
.pagination {
  height: 50px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
}
.el-button {
  background-color: #fda02a;
  color: #fff;
  width: 80px;
  margin-left: 180px;
}
.merss {
  text-align: center;
}
</style>
